package PTA;

import java.util.Scanner;

public class PTA_7_57 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        boolean flag = S.matches("[0-2][0-5][0-5]\\." +
                "[0-2][0-5][0-5]\\." +
                "[0-2][0-5][0-5]\\." +
                "[0-2][0-5][0-5]");
        if(flag) {
            System.out.println(S + "是合法的IP地址");
        }
        else {
            System.out.println(S + "不是合法的IP地址");
        }
    }
}


